$OpenBSD: patch-nix_machine_c,v 1.3 2013/04/03 15:14:17 naddy Exp $
--- nix/machine.c.orig	Thu Jan 12 07:53:00 1995
+++ nix/machine.c	Wed Apr  3 17:05:00 2013
@@ -20,6 +20,7 @@
 ***********************************************************************/
 
 #include <stdlib.h>
+#include <string.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <sys/types.h>
@@ -335,8 +336,10 @@ char *md_timestring(unsigned long t) {
     
     static char ts[22];
     struct tm *tim;	
+    time_t tt;
     
-    tim=localtime((long *)&t);
+    tt = t;
+    tim=localtime(&tt);
     sprintf(ts,"%04d-%02d-%02d  %02d:%02d",tim->tm_year+1900,tim->tm_mon+1,
 	    tim->tm_mday,tim->tm_hour,tim->tm_min);
     return ts;	
@@ -417,7 +420,7 @@ char *md_stripname(char *mdfullpath) {
     if (plainname!=NULL) free(plainname),plainname=NULL;
     if ((plainname=malloc(strlen(mdfullpath)+1))==NULL) 
       error(1,ERR_MEM,"md_stripname()");
-    for (i=strlen(mdfullpath)-1;i>0;i--) {
+    for (i=strlen(mdfullpath)-1;i>=0;i--) {
 	if (mdfullpath[i]=='/') {
 	    i++;
 	    break;
